import pymysql.cursors
connect=pymysql.Connect(
    host='localhost',
    port=3306,
    user='root',
    passwd='315315',
    db='wanjia',
    charset='utf8'
 )
cursor=connect.cursor()
sql="insert into message(airid,number,departure,destination,start,arrive,place,form)values('%d','%d','%s','%s','%s','%s','%d','%s')"
data1=(1001,11,'北京','广东','12点','13点',500,'经济舱')
data2=(1002,12,'武汉','四川','12点','13点',1000,'经济舱')
data3=(1003,13,'北京','武汉','12点','13点',2000,'头等舱')
cursor.execute(sql % data1)
cursor.execute(sql % data2)
cursor.execute(sql % data3)
connect.commit()
print('')
